<%-- 
    Document   : pesquisarUsuario
    Created on : 24/10/2011, 18:01:31
    Author     : Maury
--%>

<%@page import="Exceptions.PrivilegioInsuficienteException"%>
<%@page import="Model.Usuario"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@include file = "autenticacaoAdministrador.jsp"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Sistema Controle de Reservas</title>
    </head>
    <body>
        <%             
            String destino = request.getParameter("destino");
            if(destino == null){
                destino = (String) session.getAttribute("destino");
                if(destino == null){
                    throw new ServletException();
                }
            }
            session.setAttribute("destino", destino);
            String link = null;
            
            if(destino.equals("remover")){
                link = "removerUsuario.jsp";
            }
            else if(destino.equals("bloquear")){
                link = "bloquearUsuario.jsp";
            }
            else if(destino.equals("mudarPermissao")){
                link = "mudarPermissao.jsp";
            }
            else{
                throw new ServletException();
            } 
        %>
        <h1>Pesquisar Usuário:</h1>
        <div id="message">${erro}</div>
        <form method="post" action="MainAccessServlet" accept-charset="iso-8859-1,utf-8">
            <input type="hidden" name="cmd" value="pesquisarUsuario"/>
            <input type="hidden" name="link" value="<%=link%>"/>
            Login: <input type="text" name="loginPesquisa"/><br>
            <br>            
            <input type="submit" value="Pesquisar"/><input type="reset" value="Limpar"/>
            <button type="button" onclick="location.href='menuAdministrador.jsp'">Voltar</button>
            <hr>
            Deixe os campos em branco para mostrar todos os Usuários!
        </form>
    </body>
</html>
